import request from '@/utils/request'

// 查询unit列表
export function listUnit(query) {
  return request({
    url: '/system/unit/list',
    method: 'get',
    params: query
  })
}

// 查询unit详细
export function getUnit(id) {
  return request({
    url: '/system/unit/' + id,
    method: 'get'
  })
}

// 新增unit
export function addUnit(data) {
  return request({
    url: '/system/unit',
    method: 'post',
    data: data
  })
}

// 修改unit
export function updateUnit(data) {
  return request({
    url: '/system/unit',
    method: 'put',
    data: data
  })
}

// 删除unit
export function delUnit(id) {
  return request({
    url: '/system/unit/' + id,
    method: 'delete'
  })
}

export function unitList(){
  return request({
    url: 'system/unit/unit',
    method: 'post'
  })
}

// 校验当前楼宇下是否存在内容
export function searchAll(id) {
  return request({
    url: '/system/unit/del/' + id,
    method: 'delete'
  })
}
